# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1Application do
  @moduledoc """
  A Beyondcorp Application resource information.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the resource was created.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. An arbitrary user-provided name for the Application resource. Cannot exceed 64 characters.
  *   `endpointMatchers` (*type:* `list(GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1EndpointMatcher.t)`, *default:* `nil`) - Required. Endpoint matchers associated with an application. A combination of hostname and ports as endpoint matcher is used to match the application. Match conditions for OR logic. An array of match conditions to allow for multiple matching criteria. The rule is considered a match if one the conditions are met. The conditions can be one of the following combination (Hostname), (Hostname & Ports) EXAMPLES: Hostname - ("*.abc.com"), ("xyz.abc.com") Hostname and Ports - ("abc.com" and "22"), ("abc.com" and "22,33") etc
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Name of the resource.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the resource was last modified.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :endpointMatchers =>
            list(
              GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1EndpointMatcher.t()
            )
            | nil,
          :name => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:displayName)

  field(:endpointMatchers,
    as: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1EndpointMatcher,
    type: :list
  )

  field(:name)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1Application do
  def decode(value, options) do
    GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1Application.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.BeyondCorp.V1.Model.GoogleCloudBeyondcorpSecuritygatewaysV1Application do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
